/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BoardAttribute;

import engineMoving.Point;



/**
 *
 * @author User
 */
public class Ular {
    private Point posisiKepala;
    private Point posisiEkor;
    private int [][] arrayBoard;
    
    public Ular() {
    }
    
    
    public void setPosisi1(int [][] arrayBoard){
//        Point posisiKepala1 = new Point(7,7);
//        Point posisiKepala2 = new Point(6,2);
//        Point posisiKepala3 = new Point(5,9);
//        Point posisiKepala4 = new Point(1,7);
//        Point posisiKepala5 = new Point(0,3);
//        Point posisiEkor1 = new Point(9,5);
//        Point posisiEkor2 = new Point(8,4);
//        Point posisiEkor3 = new Point(8,9);
//        Point posisiEkor4 = new Point(6,5);
//        Point posisiEkor5 = new Point(3,0);
          
          arrayBoard[7][7]=1;
          arrayBoard[6][2]=1;
          arrayBoard[5][9]=1;
          arrayBoard[1][7]=1;
          arrayBoard[0][3]=1;
          this.arrayBoard = arrayBoard;
    }
    
    public void setPosisi2(int [][] arrayBoard){
       
        arrayBoard[1][3]=1;
          arrayBoard[5][3]=1;
          arrayBoard[0][2]=1;
          arrayBoard[2][8]=1;
          arrayBoard[1][3]=1;
           this.arrayBoard = arrayBoard;  
    }
    
    public void setPosisi3(int [][] arrayBoard){
         
        arrayBoard[7][4]=1;
          arrayBoard[4][1]=1;
          arrayBoard[5][9]=1;
          arrayBoard[0][5]=1;
          arrayBoard[3][6]=1;
          this.arrayBoard = arrayBoard; 
    }
    
    public Point getPosisiKepala(){
        return posisiKepala;
    }
    
    public Point getPosisiEkor(){
        return posisiEkor;
    }
    
    public boolean cekUlar(Point posisi){
        if(this.arrayBoard[posisi.getX()][posisi.getY()]==1){
            return true;
        }else{
            return false;
        }
    }
}
